-- GENERATED SPELL FOR [Prismatic Exile] --


function spell0_2887(pUnit, Event) --@Fireball,n/a--
pUnit:FullCastSpellOnTarget(34083,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_2887', 3000, 1)
end

function spell1_2887(pUnit, Event) --@Frost Nova,Self--
pUnit:FullCastSpellOnTarget(11831,pUnit)
pUnit:RegisterEvent('Sorts_2887', 8309, 1)
end

function spell2_2887(pUnit, Event) --@Lightning Shield,n/a--
pUnit:FullCastSpellOnTarget(12550,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_2887', 0, 1)
end

function Sorts_2887(pUnit, Event)
local choix_sorts_2887 = math.random(0, 2)
if choix_sorts_2887 == 0 then
pUnit:RegisterEvent('spell0_2887', 1, 1)
end
if choix_sorts_2887 == 1 then
pUnit:RegisterEvent('spell1_2887', 1, 1)
end
if choix_sorts_2887 == 2 then
pUnit:RegisterEvent('spell2_2887', 1, 1)
end
end

function mob2887_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_2887', math.random(1500, 3000), 1)
end

function mob2887_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob2887_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob2887_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(2887, 1, 'mob2887_Action')
RegisterUnitEvent(2887, 2, 'mob2887_Leave')
RegisterUnitEvent(2887, 3, 'mob2887_Kill')
RegisterUnitEvent(2887, 4, 'mob2887_Die')
